import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import java.util.List;
import javax.swing.*;

import java.awt.*;

import javax.swing.JPanel;

public class editFeature extends JPanel implements MouseListener, MouseMotionListener{
	private Connection connect;
	 private Image background,save, cancel;
	 private JTextField feat, feat2, feat3, feat4;
	 private int goNext=0;
	 
	 public editFeature(){
		 loadImages();
		 
		 feat = new JTextField(50);
		 feat2 = new JTextField(50);
		 feat3 = new JTextField(50);
		 feat4 = new JTextField(50);
		 
		 setLayout(null);
		 	feat.setBounds(460,215,300,30);
			feat2.setBounds(460,255,300,30);
			feat3.setBounds(460,297,300,30);
			feat4.setBounds(460,339,300,30);
			
			add(feat);
			add(feat2);
			add(feat3);
			add(feat4);
			
			feat.addMouseListener(this);
		    feat2.addMouseListener(this);
		    feat3.addMouseListener(this);
		    feat4.addMouseListener(this);
	 }
	
	public void loadImages(){
	       try{
	           background = new ImageIcon("pics/editFeature.png").getImage();
	           save = new ImageIcon("pics/save.png").getImage();
	           cancel = new ImageIcon("pics/cancel.png").getImage();
	          
	        } catch (Exception e) { }
	       
	       repaint();
	   }
	   
	   public void paintComponent(Graphics g){
	       super.paintComponent(g);
	       Graphics2D g2d = (Graphics2D) g;
	       setForeground(Color.black);
	       setFont(new Font("Tahoma",Font.PLAIN,22));
	       g2d.drawImage(background, 0, 0, this);
	       g2d.drawString("editFeature",180,140);
	       g2d.drawImage(save, 475, 590, this);
	       g2d.drawImage(cancel, 625, 590, this);
	       
	   }
	   
	   public void setGoNext(int d){
		   goNext=1;
	   }
	   
	   public int getGoNext(){
		  return goNext; 
	   }
	   
	   public void Loopy(){
			while(goNext!=1)
				repaint();
			}
	
	
	public void mouseClicked(MouseEvent me) {
	   	
	   }
	   public void mousePressed(MouseEvent me) {
	       
	   }
	   public void mouseReleased(MouseEvent me) {
	       
	   }
	   public void mouseDragged(MouseEvent me) {
	       
	   }
	   public void mouseMoved(MouseEvent me) {
	   
	   }    
	   public void mouseEntered(MouseEvent me) {
	       
	   }
	   public void mouseExited(MouseEvent me) {
	       
	   }
}
